/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/

#ifndef PAGEERRORTEST_H
#define PAGEERRORTEST_H

#include <QWidget>
#include <QtGui>
#include "clickedLabel.h"
#include "pagesource.h"
#include "pagepacketdetail.h"
#include "pageharmonic.h"
#include "pagestatistic.h"
#include "pagepower.h"

#include "qcustomplot/qcustomplot.h"

class errorTestPage : public QWidget
{
    Q_OBJECT

public:
    errorTestPage(QWidget *parent = 0);

public:
    typedef struct _ETC_Send
    {
        char    de_name[6];
        char	sf;    /*算法选择  0表示工程算法，1表示理论算法, ! 表示复位 # 表示延时时间测量 */
        char	tbfs;  /*同步方式  0,同步输出；1,电秒脉冲；2,光秒脉冲3,B码电信号；4,B码光信号；5,50Hz倍频*/
        char	bzxz;  /*标准选择  0,5A；1,1A；2,100V；3,100/√3V；4,模拟小电压；5,谐波小电压*/
        float	xdyz;  /*小电压值  如果标准选择为4或者5，则有数，否则用0填充*/
        char    bcxz;  /*被测选择  0,5A；1,1A；2,100V；3,100/√3V；4,模拟小电压；5,9-1/2；6，FT3*/
        float   ydyz;   /*多样值    如果被测选择为0~3,则全部填充为0;如果为4,则用float类型填充;如果为5或者6,则填写通道号;*/
        char    ft3_tdh;    /*ft3通道号*/
        char	xbNum; /*谐波次数*/
        float   xbValue; /*谐波有效值*/
        char    netport[4];    /*输入端口*/
        char    ex[20];
    }ETC_Send;

    bool digi_tdlb_show[6];

public:
    void getsendUdp(char* ch,int flag);
    int getStructLen();

    pageHarmonic *harmonicAnalyze;
    staticPage *resultAnalyze;

    powerPage *powerAnalyze;

public:
    QLabel *labSync;
    QLabel *labFreq;
    QStackedWidget *mainPages;
    QTabWidget *extPages;
    QWidget *paintArea;
    pageSource *sourcePage;

    QPushButton *btnAnalyzeHarmonic;
    QPushButton *btnAnalyzeProtocol;
    QPushButton *btnStart;//开始按钮
    QPushButton *btnSource;

    QPushButton *btnBack;

    QLabel *labPhaseAURms;
    QLabel *labPhaseAIRms;

    QLabel *labPhaseBURms;
    QLabel *labPhaseBIRms;

    QLabel *labPhaseCURms;
    QLabel *labPhaseCIRms;

    QLabel *labAUPhaseReal;
    QLabel *labBUPhaseReal;
    QLabel *labCUPhaseReal;

    QLabel *labAIPhaseReal;
    QLabel *labBIPhaseReal;
    QLabel *labCIPhaseReal;

    QLabel *labPhaseAUTest;
    QLabel *labPhaseAITest;

    QLabel *labPhaseBUTest;
    QLabel *labPhaseBITest;

    QLabel *labPhaseCUTest;
    QLabel *labPhaseCITest;

    QLabel *labAUPhaseTest;
    QLabel *labBUPhaseTest;
    QLabel *labCUPhaseTest;

    QLabel *labAIPhaseTest;
    QLabel *labBIPhaseTest;
    QLabel *labCIPhaseTest;

    QLabel *labPhaseAUDelay;
    QLabel *labPhaseBUDelay;
    QLabel *labPhaseCUDelay;

    QLabel *labPhaseAIDelay;
    QLabel *labPhaseBIDelay;
    QLabel *labPhaseCIDelay;

    // real value of the standard
    QLabel *labPhaseAUReal;
    QLabel *labPhaseAIReal;

    QLabel *labPhaseBUReal;
    QLabel *labPhaseBIReal;

    QLabel *labPhaseCUReal;
    QLabel *labPhaseCIReal;

    QLabel *labPhaseAUError;
    QLabel *labPhaseBUError;
    QLabel *labPhaseCUError;

    QLabel *labPhaseAIError;
    QLabel *labPhaseBIError;
    QLabel *labPhaseCIError;

    pagePacketDetail *pageAll;

private:
    ClickableLabel *labUA1;
    ClickableLabel *labUB1;
    ClickableLabel *labUC1;
    ClickableLabel *labIA1;
    ClickableLabel *labIB1;
    ClickableLabel *labIC1;

public slots:
    void chageMainPage();
    void chageMainPage2();
    void changeChannelShow();
    void back2Main();

signals:

};

#endif
